//
//  SACompanyNewsViewController.m
//  SunOn
//
//  Created by RazeenCheng on 2017/5/4.
//  Copyright © 2017年 NeoZhang. All rights reserved.
//

#import "SACompanyNewsViewController.h"
#import "SACompanyNewsListTableViewCell.h"

@interface SACompanyNewsViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end

@implementation SACompanyNewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    
    // 68 34 40
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SACompanyNewsListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SACompanyNewsListTableViewCell" forIndexPath:indexPath];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row % 2 != 0) {
        return 65 + 44 + 50 + 3;
    }
    
    return 65 + 44 + 50 + (SASCREEN_WIDTH - 30) * 600 / 1162 + 3;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

@end
